package pl.edu.agh.uddiProxy.client.admin;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

public interface UserService extends RemoteService {
	String SERVICE_URI = "/userService.rpc";
	
	public static final class Util {
		private Util() {
		}
		
		public static UserServiceAsync getInstance() {
			UserServiceAsync instance = (UserServiceAsync) GWT.create(UserService.class);
			ServiceDefTarget target = (ServiceDefTarget) instance;
			target.setServiceEntryPoint(GWT.getModuleBaseURL() + SERVICE_URI);
			return instance;
		}
	}
	
	List<String> getUsers();
	User getUserDetails(String username);
	void createUser(User user) throws UserAlreadyExists;
	void deleteUser(String username);
	void updateUser(User user);
}

